I want to check the rationale and details of our previous filtering philosophy as Jun had the feeling that we removed too many cells. We also removed too many genes, e.g. highly tissue specific genes such as myl7 are not part of the final data set any longer, which is something that we need to go back on.
sce <- readRDS(paste0(data_dir, "sce_ZF-allSamples-Integrated_2022-01-12_noCounts.rds"))
rownames(sce) <- scater::uniquifyFeatureNames(rowData(sce)$ID, rowData(sce)$Symbol)
sce$old_labels_coarse <- ifelse(grepl("Macrophage", sce$label), "M0",
ifelse(grepl("T-cells", sce$label), "Tcell",
ifelse(grepl("Fibroblast", sce$label),"Fibroblast",
ifelse(grepl("Cardiomyocyte", sce$label), "CM",
ifelse(grepl("Endocardium", sce$label),"Endocard.",
ifelse(grepl("Epicardium", sce$label), "Epicard.",
ifelse(grepl("Ery", sce$label), "Ery",
ifelse(grepl("eutroph", sce$label), "Neutrophils",
ifelse(grepl("delta", sce$label), "delta",
ifelse(grepl("EC_", sce$label), "EC",
ifelse(grepl("ndothelial", sce$label), "EC", sce$label)))))))))))
sce$old_labels_coarse <- gsub("-cells", "cell", sce$old_labels_coarse)
sce$old_labels_coarse <- gsub("cells$", "", sce$old_labels_coarse)
p1 <-scABC2::plot_reducedDim_from_sce(sce,
which_reddim = "UMAP", color_by = "hbba1_ENSDARG00000097238",
exprs_values = "logcounts",
size_by = .5, alpha = .3, set_colors = FALSE,
remove_rug=TRUE,
add_cell_info = c("Tissue","post.surgery")) +
facet_grid(.~Tissue) + scale_color_viridis_c(direction=-1) +theme(legend.position = "bottom") + ggtitle("Ery marker")
p2 <-dittoSeq::dittoBoxPlot(sce,
var = "hbba1_ENSDARG00000097238",
group.by = "cluster_k200", split.by = "Tissue",
boxplot.lineweight = 0.1, jitter.size = .2, jitter.width=0.5)
p1 + p2
plot_reducedDim_from_sce(sce[, as.character(sce$cluster_k200) %in% c("7","9","13")],
which_reddim = "UMAP",
color_by = "cluster_k200",
add_cell_info = "Tissue") +
facet_wrap(~Tissue)+ ggtitle("Clusters 7, 9, 13 (high Hbba1)")
plot_reducedDim_from_sce(sce, which_reddim = "UMAP",
color_by = list(title="Ery label?",
result = ifelse(sce$old_labels_coarse == "Ery", TRUE, FALSE)))
plot_reducedDim_from_sce(sce, which_reddim = "UMAP",
color_by = list(
title="Ery label?",
result = ifelse(sce$old_labels_coarse == "Ery", TRUE, FALSE)),
add_cell_info = c("Tissue")) + facet_wrap(~Tissue)
–> check (a) CM markers, (b) liver markers [hepatocytes, cholangiocytes]
goidt <- scABC2::make_long_dt(sce, exprs_values = "logcounts",
features = c("ttn.2","tnni1b", # CM
"col1a1a", #epicardial
"hbba1_ENSDARG00000097238", # ery
"cela1.6", #exocrine pancreas
"tfa","fabp10a", #hepatocytes,
"lgals2b", #cholangiocytes
"colec11", # HepSC
"itga2b", # megakaryo
"slc4a1a" # ery
),
include_metaData = c("cluster_k200", "old_labels_coarse","Tissue","Sample","post.surgery","detected","subsets_mito_percent"))
goidt <- dcast(goidt, cell + Tissue + post.surgery + cluster_k200 + Sample + subsets_mito_percent + detected + old_labels_coarse ~ feature_name, value.var = "logcounts")
setnames(goidt, "hbba1_ENSDARG00000097238", "hbba1")
ggplot(goidt, aes(x = ttn.2, y = hbba1, color = cluster_k200)) +
geom_point(size = 1.5, alpha = .2, shape = 1) +
facet_grid(Tissue~post.surgery) +
scale_color_manual(values = ABCutilities:::fx.get_palette_ABC("paired_pal")) +
guides(color = guide_legend(override.aes = list(size = 3, alpha =1, shape = 16) ) )
plot_reducedDim_from_sce(sce[, as.character(sce$cluster_k200) %in% c("7","9","13")],
which_reddim = "UMAP",
color_by = "ttn.2", exprs_values = "logcounts",
add_cell_info = "Tissue", set_color = FALSE) +
facet_wrap(~Tissue)+ ggtitle("CM marker", subtitle="Clusters 7, 9, 13 (high Hbba1)") + scale_color_viridis_c(direction = -1, option = "magma")
ggplot(goidt, aes(x = colec11, y = hbba1, color = cluster_k200)) +
geom_point(size = 1.5, alpha = .2, shape = 1) +
facet_grid(Tissue~post.surgery) +
scale_color_manual(values = ABCutilities:::fx.get_palette_ABC("paired_pal")) +
guides(color = guide_legend(override.aes = list(size = 3, alpha =1, shape = 16) ) ) +
ggtitle("Cholangiocyte marker")
ggplot(goidt, aes(x = fabp10a, y = hbba1, color = cluster_k200)) +
geom_point(size = 1.5, alpha = .2, shape = 1) +
facet_grid(Tissue~post.surgery) +
scale_color_manual(values = ABCutilities:::fx.get_palette_ABC("paired_pal")) +
guides(color = guide_legend(override.aes = list(size = 3, alpha =1, shape = 16) ) ) +
ggtitle("Hepatocyte marker")
dittoSeq::dittoBoxPlot(sce[,sce$Tissue=="Liver"], var = "detected",
group.by = "Sample", split.by = "cluster_k200",
boxplot.lineweight = .1, jitter.size = .5, main = "Liver samples only")
plot_reducedDim_from_sce(sce[, sce$Tissue == "Liver"],
which_reddim = "UMAP",
color_by = "subsets_mito_percent", exprs_values = "logcounts",
add_cell_info = c("cluster_k200","Tissue"), set_color = FALSE) +
facet_wrap(~Tissue)+ ggtitle("Liver cells only") +
scale_color_viridis_c() + facet_wrap(~cluster_k200) +
theme(legend.position = "bottom")
There seem to be two mito-populations in cluster 7.
ggplot(goidt[Tissue == "Liver"],
aes(x = fabp10a, y = hbba1, color = subsets_mito_percent)) +
geom_point(size = 1.5, alpha = .2, shape = 1) +
facet_grid(post.surgery~cluster_k200) +
scale_color_viridis_c()+
guides(color = guide_legend(override.aes = list(size = 3, alpha =1, shape = 16) ) ) +
ggtitle("Hepatocytes only") + theme(legend.position = "bottom")
ggplot(goidt[Tissue == "Liver"],
aes(x = fabp10a, color = hbba1, y = detected)) +
geom_point(size = 1.5, alpha = .2, shape = 1) +
facet_grid(post.surgery~cluster_k200) +
scale_color_viridis_c(direction=-1, option = "magma")+
guides(color = guide_legend(override.aes = list(size = 3, alpha =1, shape = 16) ) ) +
ggtitle("Hepatocytes only") + theme(legend.position = "bottom")
ggplot(goidt, aes(x = cela1.6, y = hbba1, color = cluster_k200)) +
geom_point(size = 1.5, alpha = .2, shape = 1) +
facet_grid(Tissue~post.surgery) +
scale_color_manual(values = ABCutilities:::fx.get_palette_ABC("paired_pal")) +
guides(color = guide_legend(override.aes = list(size = 3, alpha =1, shape = 16) ) ) +
ggtitle("Acinar cell marker")